package com.xiaoyi.intentsdklibrary.Bean;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

public class MsgBeanDao extends AbstractDao<MsgBean, Long> {
    public static final String TABLENAME = "MSG_BEAN";

    public static class Properties {
        public static final Property Account_id = new Property(3, String.class, "account_id", false, "ACCOUNT_ID");
        public static final Property Checked_flag = new Property(6, Boolean.TYPE, "checked_flag", false, "CHECKED_FLAG");
        public static final Property Date = new Property(7, String.class, "date", false, "DATE");
        public static final Property Grade_content = new Property(5, String.class, "grade_content", false, "GRADE_CONTENT");
        public static final Property Grade_id = new Property(1, String.class, "grade_id", false, "GRADE_ID");
        public static final Property Grade_level = new Property(4, String.class, "grade_level", false, "GRADE_LEVEL");
        public static final Property Id = new Property(0, Long.class, "id", true, "_id");
        public static final Property Remark = new Property(8, String.class, "remark", false, "REMARK");
        public static final Property Script_id = new Property(2, String.class, "script_id", false, "SCRIPT_ID");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return true;
    }

    public MsgBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public MsgBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"MSG_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"GRADE_ID\" TEXT UNIQUE ,\"SCRIPT_ID\" TEXT,\"ACCOUNT_ID\" TEXT,\"GRADE_LEVEL\" TEXT,\"GRADE_CONTENT\" TEXT,\"CHECKED_FLAG\" INTEGER NOT NULL ,\"DATE\" TEXT,\"REMARK\" TEXT);");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"MSG_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, MsgBean msgBean) {
        databaseStatement.clearBindings();
        Long id = msgBean.getId();
        if (id != null) {
            databaseStatement.bindLong(1, id.longValue());
        }
        String grade_id = msgBean.getGrade_id();
        if (grade_id != null) {
            databaseStatement.bindString(2, grade_id);
        }
        String script_id = msgBean.getScript_id();
        if (script_id != null) {
            databaseStatement.bindString(3, script_id);
        }
        String account_id = msgBean.getAccount_id();
        if (account_id != null) {
            databaseStatement.bindString(4, account_id);
        }
        String grade_level = msgBean.getGrade_level();
        if (grade_level != null) {
            databaseStatement.bindString(5, grade_level);
        }
        String grade_content = msgBean.getGrade_content();
        if (grade_content != null) {
            databaseStatement.bindString(6, grade_content);
        }
        databaseStatement.bindLong(7, msgBean.getChecked_flag() ? 1 : 0);
        String date = msgBean.getDate();
        if (date != null) {
            databaseStatement.bindString(8, date);
        }
        String remark = msgBean.getRemark();
        if (remark != null) {
            databaseStatement.bindString(9, remark);
        }
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, MsgBean msgBean) {
        sQLiteStatement.clearBindings();
        Long id = msgBean.getId();
        if (id != null) {
            sQLiteStatement.bindLong(1, id.longValue());
        }
        String grade_id = msgBean.getGrade_id();
        if (grade_id != null) {
            sQLiteStatement.bindString(2, grade_id);
        }
        String script_id = msgBean.getScript_id();
        if (script_id != null) {
            sQLiteStatement.bindString(3, script_id);
        }
        String account_id = msgBean.getAccount_id();
        if (account_id != null) {
            sQLiteStatement.bindString(4, account_id);
        }
        String grade_level = msgBean.getGrade_level();
        if (grade_level != null) {
            sQLiteStatement.bindString(5, grade_level);
        }
        String grade_content = msgBean.getGrade_content();
        if (grade_content != null) {
            sQLiteStatement.bindString(6, grade_content);
        }
        sQLiteStatement.bindLong(7, msgBean.getChecked_flag() ? 1 : 0);
        String date = msgBean.getDate();
        if (date != null) {
            sQLiteStatement.bindString(8, date);
        }
        String remark = msgBean.getRemark();
        if (remark != null) {
            sQLiteStatement.bindString(9, remark);
        }
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public MsgBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        String string = cursor.isNull(i3) ? null : cursor.getString(i3);
        int i4 = i + 2;
        String string2 = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        String string3 = cursor.isNull(i5) ? null : cursor.getString(i5);
        int i6 = i + 4;
        String string4 = cursor.isNull(i6) ? null : cursor.getString(i6);
        int i7 = i + 5;
        String string5 = cursor.isNull(i7) ? null : cursor.getString(i7);
        boolean z = cursor.getShort(i + 6) != 0;
        int i8 = i + 7;
        int i9 = i + 8;
        return new MsgBean(valueOf, string, string2, string3, string4, string5, z, cursor.isNull(i8) ? null : cursor.getString(i8), cursor.isNull(i9) ? null : cursor.getString(i9));
    }

    public void readEntity(Cursor cursor, MsgBean msgBean, int i) {
        int i2 = i + 0;
        String str = null;
        msgBean.setId(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        msgBean.setGrade_id(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 2;
        msgBean.setScript_id(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        msgBean.setAccount_id(cursor.isNull(i5) ? null : cursor.getString(i5));
        int i6 = i + 4;
        msgBean.setGrade_level(cursor.isNull(i6) ? null : cursor.getString(i6));
        int i7 = i + 5;
        msgBean.setGrade_content(cursor.isNull(i7) ? null : cursor.getString(i7));
        msgBean.setChecked_flag(cursor.getShort(i + 6) != 0);
        int i8 = i + 7;
        msgBean.setDate(cursor.isNull(i8) ? null : cursor.getString(i8));
        int i9 = i + 8;
        if (!cursor.isNull(i9)) {
            str = cursor.getString(i9);
        }
        msgBean.setRemark(str);
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(MsgBean msgBean, long j) {
        msgBean.setId(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(MsgBean msgBean) {
        if (msgBean != null) {
            return msgBean.getId();
        }
        return null;
    }

    public boolean hasKey(MsgBean msgBean) {
        return msgBean.getId() != null;
    }
}
